import request from "@/utils/request";

// 分类列表
export const categoryListApi = () => request.get('/category')

// 新增分类
export const categoryAddApi = (categoryData) => request.post('/category',categoryData)

// 删除分类【query参数】
// export const categoryDeleteApi = (Id) => request.delete('/category',Id):该写法错误
// export const categoryDeleteApi = (Id) => request.delete('/category?id='+Id)
export const categoryDeleteApi = (id) => request.delete(`/category?id=${id}`)

// 更新分类
export const categoryUpdateApi = (categoryData) => request.put('/category',categoryData)

// 获取某个详情分类数据
export const categoryDetailApi = (id) => request.get(`/category/detail?id=${id}`)